package com.cskaoyan.gateway.controller.shopping;

import com.mall.commons.result.ResponseData;
import com.mall.commons.result.ResponseUtil;
import com.mall.order.CancelOrderService;
import com.mall.order.dto.CancelOrderRequest;
import com.mall.order.dto.CancelOrderResponse;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.*;

/**
 * @author TL
 * @created Date:2020/12/21 Time:19:09
 **/
@RestController
@RequestMapping("shopping")
public class CancelOrderController {

    @Reference(timeout = 3000, retries = 0, check = false)
    CancelOrderService cancelOrderService;

    @PostMapping("cancelOrder")
    public ResponseData cancelOrderById(@RequestBody CancelOrderRequest request){
        CancelOrderResponse cancelOrderResponse = cancelOrderService.cancelOrderById(request);
        return new ResponseUtil().setData(cancelOrderResponse);
    }
}
